package net.sky.oa.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 计划用户表
 * OffPlanUser. @author hond
 */
@Entity
@Table(name = "OFF_PLAN_USER")//计划用户表
public class OffPlanUser implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	protected Long id;
	private OffPlan plan;//计划id
	private SysEmployee rusr;//查阅用户id
	private Date sendtime; //发送时间
	private Integer isread;//是否查阅：1是2否
	private Date readtime; //查阅时间

	// Constructors

	/** default constructor */
	public OffPlanUser() {
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_OFFPLANUSER_ID",sequenceName="SQ_OFFPLANUSER_ID",allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_OFFPLANUSER_ID")
	public Long getId() {
	    return id;
	}

    public void setId(Long id){
	    this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PLAN_ID")
	public OffPlan getPlan() {
		return this.plan;
	}

	public void setPlan(OffPlan plan) {
		this.plan = plan;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RUSR_ID")
	public SysEmployee getRusr() {
		return this.rusr;
	}

	public void setRusr(SysEmployee rusr) {
		this.rusr = rusr;
	}

	@Temporal(TemporalType.DATE)
	@JoinColumn(name = "SENDTIME")
	public Date getSendtime() {
		return this.sendtime;
	}

	public void setSendtime(Date sendtime) {
		this.sendtime = sendtime;
	}

	@Column(name = "ISREAD", precision = 1, scale = 0)
	public Integer getIsread() {
		return this.isread;
	}

	public void setIsread(Integer isread) {
		this.isread = isread;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "READTIME", length = 7)
	public Date getReadtime() {
		return this.readtime;
	}

	public void setReadtime(Date readtime) {
		this.readtime = readtime;
	}

}